<html>
<head><meta charset="utf-8"><title>general · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html">general</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="161377283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161377283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161377283">(Mar 21 2019 at 19:12)</a>:</h4>
<p>I am experimenting with providing some actual diagnostics!</p>



<a name="161377286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161377286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161377286">(Mar 21 2019 at 19:12)</a>:</h4>
<p><a href="/user_uploads/4715/1ZGqHEA410J3viXRO_x_1AFf/pasted_image.png" target="_blank" title="pasted_image.png">pasted image</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/1ZGqHEA410J3viXRO_x_1AFf/pasted_image.png" target="_blank" title="pasted image"><img src="/user_uploads/4715/1ZGqHEA410J3viXRO_x_1AFf/pasted_image.png"></a></div>



<a name="161778518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161778518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cole Lawrence <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161778518">(Mar 26 2019 at 16:24)</a>:</h4>
<p>How much overlap does RA and rustc have? I noticed that HIR is approaching stabilization (rustc) and would lead towards stabilizing incremental compilation. Is there overlap between rust-analyzer and that progress?</p>



<a name="161778716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161778716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161778716">(Mar 26 2019 at 16:27)</a>:</h4>
<p>There's not that much overlap happening at the moment unfortunately. The most interesting bits, from IDE perspective, tend to happen before hir (syntax trees, parsing, macro expansion), so ra currently attacks those.</p>



<a name="161778875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161778875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161778875">(Mar 26 2019 at 16:29)</a>:</h4>
<p>Though, producing HIR/MIR using ra frontend is one long-term path to merging the projects. </p>
<p>Another long-term path is librarification: for example, both rustc and ra could use chalk. We hope to produce similar libraries for name resolution, etc</p>



<a name="161778883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161778883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cole Lawrence <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161778883">(Mar 26 2019 at 16:29)</a>:</h4>
<p>Is there an issue or documentation describing why "traits" are far into the future? <a href="https://github.com/rust-analyzer/rust-analyzer/issues/909#issuecomment-468366485" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/909#issuecomment-468366485">https://github.com/rust-analyzer/rust-analyzer/issues/909#issuecomment-468366485</a></p>



<a name="161779023"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161779023" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161779023">(Mar 26 2019 at 16:30)</a>:</h4>
<p>well, time flies fast in rust-analyzer, 26 days ago is a distant past :) We already started on chalk integration, see <code>wg-rls-2.0/chalk</code> subgroup :)</p>



<a name="161779780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161779780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161779780">(Mar 26 2019 at 16:39)</a>:</h4>
<p><span class="user-mention" data-user-id="215394">@Cole Lawrence</span> this the paper doc from planing the traits: <a href="https://paper.dropbox.com/doc/Chalk-RLS-integration--AaBRVmOY2Qv~GNc~8re8bL_RAg-QCJelXDeaq7GV6jVQln4j" target="_blank" title="https://paper.dropbox.com/doc/Chalk-RLS-integration--AaBRVmOY2Qv~GNc~8re8bL_RAg-QCJelXDeaq7GV6jVQln4j">https://paper.dropbox.com/doc/Chalk-RLS-integration--AaBRVmOY2Qv~GNc~8re8bL_RAg-QCJelXDeaq7GV6jVQln4j</a>, you might find it interesting</p>



<a name="161780346"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161780346" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cole Lawrence <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161780346">(Mar 26 2019 at 16:45)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="133169">@matklad</span> I'll start reading into chalk and salsa and see where that takes me :-)</p>



<a name="161780479"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161780479" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161780479">(Mar 26 2019 at 16:46)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="129457">@Florian Diebold</span> , do we have some good-first-bug issues for chalk integration? :)</p>



<a name="161781699"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161781699" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161781699">(Mar 26 2019 at 16:59)</a>:</h4>
<p>hmm not really so far, I'll need to think a bit about the next steps, maybe then I'll come up with something...</p>



<a name="161862848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161862848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161862848">(Mar 27 2019 at 14:15)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> Looks like the VM is stuck booting on Travis.</p>



<a name="161864276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161864276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161864276">(Mar 27 2019 at 14:29)</a>:</h4>
<p>Looks like it finally went through.</p>



<a name="161885683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161885683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cole Lawrence <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161885683">(Mar 27 2019 at 18:12)</a>:</h4>
<p>Kinda a weird idea, but has anyone considered that HIR could be used as a set of building blocks to create a structural editor? Think of like Scratch... But it translates into HIR-&gt;MIR-&gt;LLVM</p>



<a name="161885776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161885776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cole Lawrence <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161885776">(Mar 27 2019 at 18:13)</a>:</h4>
<p>Can rust-analyzer HIR be translated to Rustc HIR? I imagined that this would have to be built on top of rustc's HIR</p>



<a name="161885869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161885869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Cole Lawrence <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161885869">(Mar 27 2019 at 18:14)</a>:</h4>
<p>Then, with <code>chalk</code> it seems like there would be a lot of heavy lifting with type support taken to build off of</p>



<a name="161922401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161922401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Czub <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161922401">(Mar 28 2019 at 04:10)</a>:</h4>
<p>Is it possible to pass a feature flag in a project with <code>rust-analyzer</code>'s VSCode integration? In the <code>rls</code> VSCode extension you can pass <code>rust.features</code> but I didn't see anything similar in <code>rust-analyzer</code></p>



<a name="161926926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161926926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161926926">(Mar 28 2019 at 06:14)</a>:</h4>
<p><span class="user-mention" data-user-id="215675">@Chris Czub</span> we don't hande cfg's yet, so we don't support <code>feature</code> in any specific way</p>



<a name="161926954"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/161926954" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#161926954">(Mar 28 2019 at 06:15)</a>:</h4>
<p><span class="user-mention" data-user-id="215394">@Cole Lawrence</span> maybe? Though, I might be a wrong person to ask: based on what I know about JetBrains MPS, I am <strong>very</strong> strongly biased towards the plain text representation + good idea support (basically, extend selection gives you 90% of paredit for any language anyway) :)</p>



<a name="162005801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/162005801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Chris Czub <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#162005801">(Mar 29 2019 at 00:23)</a>:</h4>
<p>Is this being tracked in GitHub?</p>



<a name="162020100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/162020100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#162020100">(Mar 29 2019 at 05:39)</a>:</h4>
<p><span class="user-mention" data-user-id="215675">@Chris Czub</span>  no, might be a good idea to create one!</p>



<a name="163486191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163486191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163486191">(Apr 16 2019 at 16:52)</a>:</h4>
<p>Do anyone try to run cargo test for master in rustc 1.34 (Windows) , It seem to be dead lock in <code>test_runnables_project</code>.</p>
<div class="codehilite"><pre><span></span>cargo test test_runnables_project -- --nocapture
</pre></div>



<a name="163486223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163486223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163486223">(Apr 16 2019 at 16:52)</a>:</h4>
<p>I just wanna know whether it is my own machine problem, I tested it in macos and its works.</p>



<a name="163508045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163508045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> marcogroppo <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163508045">(Apr 16 2019 at 21:18)</a>:</h4>
<blockquote>
<p>Do anyone try to run cargo test for master in rustc 1.34 (Windows) , It seem to be dead lock in <code>test_runnables_project</code>.</p>
</blockquote>
<p>Hi! I have the same problem... it started happening after a recent (&lt; 7 days ago) commit, I have another (older) branch where the test runs fine</p>



<a name="163508825"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163508825" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163508825">(Apr 16 2019 at 21:28)</a>:</h4>
<p>It might be multiple-workspaces support</p>



<a name="163524345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163524345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163524345">(Apr 17 2019 at 02:11)</a>:</h4>
<p><span class="user-mention" data-user-id="215645">@Marco Groppo</span> Thanks, i filed a issue in github for that. I will dig a little bit deeper to try understand whats happened.</p>



<a name="163716834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163716834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163716834">(Apr 19 2019 at 06:25)</a>:</h4>
<p>Hi, I am working on <a href="https://github.com/rust-analyzer/rust-analyzer/issues/1149" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/1149">https://github.com/rust-analyzer/rust-analyzer/issues/1149</a> And try to replace alll <code>as_source_file()</code> to <code>source_file()</code>. However, after i change and build codes in <code>navigation_target.rs</code>. the following error occurs:</p>
<div class="codehilite"><pre><span></span>error[E0599]: no method named `parse` found for type `&amp;&amp;db::RootDatabase` in the current scope
  --&gt; crates\ra_ide_api\src\references.rs:63:22
   |
63 |     let file = db.parse(position.file_id);
   |                      ^^^^^
   |
   = note: the method `parse` exists but the following trait bounds were not satisfied:
           `&amp;&amp;db::RootDatabase : ra_db::SourceDatabase`
           `&amp;db::RootDatabase : ra_db::SourceDatabase`
           `db::RootDatabase : ra_db::SourceDatabase`
   = help: items from traits can only be used if the trait is implemented and in scope
   = note: the following trait defines an item `parse`, perhaps you need to implement it:
           candidate #1: `ra_db::SourceDatabase`
</pre></div>


<p>I am not familiar how <code>salsa</code> works,  but i am so sure i imported SourceDataBase and RootDatabase in that file. (i didn't change any imports in that file), do anyone know why ? I can make it pass by change it to <code>(db as SourceDataBase).parse</code> , but just feel so weird ...</p>



<a name="163716898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163716898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163716898">(Apr 19 2019 at 06:26)</a>:</h4>
<p>That's a bug with incremental compilation</p>



<a name="163716980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163716980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163716980">(Apr 19 2019 at 06:28)</a>:</h4>
<p>You can fix it using something like <code>rm -rf ./target/debug/incremental/</code> (sadly only temporarily, it can happen again)</p>



<a name="163716982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163716982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163716982">(Apr 19 2019 at 06:28)</a>:</h4>
<p>See this issue: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/826" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/issues/826">https://github.com/rust-analyzer/rust-analyzer/issues/826</a></p>



<a name="163717011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163717011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163717011">(Apr 19 2019 at 06:29)</a>:</h4>
<p>Might be fixed on newer Rust versions, though</p>



<a name="163717066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163717066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163717066">(Apr 19 2019 at 06:30)</a>:</h4>
<p>Oh .. that's so weird.  thanks a lot.</p>



<a name="163722037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163722037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163722037">(Apr 19 2019 at 08:33)</a>:</h4>
<p>I think the current rustc-side issue is <a href="https://github.com/rust-lang/rust/issues/60010" target="_blank" title="https://github.com/rust-lang/rust/issues/60010">https://github.com/rust-lang/rust/issues/60010</a></p>



<a name="163728859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/163728859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#163728859">(Apr 19 2019 at 11:17)</a>:</h4>
<p>(technically the rustc-side issue is  <a href="https://github.com/rust-lang/rust/issues/58291" target="_blank" title="https://github.com/rust-lang/rust/issues/58291">#58291</a> ; <a href="https://github.com/rust-lang/rust/issues/60010" target="_blank" title="https://github.com/rust-lang/rust/issues/60010">#60010</a> may or may not be related to the root cause)</p>



<a name="164285842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164285842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> L.apz <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164285842">(Apr 26 2019 at 18:23)</a>:</h4>
<p>Recently the rls has been panicking for me and it seems to be casued by the type inference query. I got a backtrace here <a href="https://gist.github.com/Lapz/0589bb8fbcd8f631b034356b64983a11" target="_blank" title="https://gist.github.com/Lapz/0589bb8fbcd8f631b034356b64983a11">https://gist.github.com/Lapz/0589bb8fbcd8f631b034356b64983a11</a>.</p>



<a name="164286031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164286031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> L.apz <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164286031">(Apr 26 2019 at 18:25)</a>:</h4>
<p>It seems to be caused by the syntax highlighting</p>



<a name="164289977"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164289977" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> L.apz <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164289977">(Apr 26 2019 at 19:16)</a>:</h4>
<p>Also i goto really slow for anyone else</p>



<a name="164291041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164291041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> L.apz <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164291041">(Apr 26 2019 at 19:30)</a>:</h4>
<p>so the last working commit was <a href="https://github.com/rust-lang/rust/commit/42c4e0f378faeabd425392d4a7a7839bd7e8ac2f" target="_blank" title="https://github.com/rust-lang/rust/commit/42c4e0f378faeabd425392d4a7a7839bd7e8ac2f">42c4e0f378faeabd425392d4a7a7839bd7e8ac2f</a></p>



<a name="164293115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164293115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164293115">(Apr 26 2019 at 19:57)</a>:</h4>
<p><span class="user-mention" data-user-id="121360">@L.apz</span>  Which commit are you on?</p>



<a name="164293264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164293264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164293264">(Apr 26 2019 at 19:59)</a>:</h4>
<p><span class="user-mention" data-user-id="121360">@L.apz</span> if you disable highlighting in the client settings does that make it go away?</p>



<a name="164293363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164293363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164293363">(Apr 26 2019 at 20:00)</a>:</h4>
<p>A test case would be useful or a github issue.</p>



<a name="164312398"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164312398" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164312398">(Apr 27 2019 at 02:08)</a>:</h4>
<p>Hello guys ! I usually use vim for rust but wanted to checkout the rust-analyzer with vs-code. <br>
How do I get my code to compile and debug with vs-code ?</p>



<a name="164312408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164312408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164312408">(Apr 27 2019 at 02:08)</a>:</h4>
<p>Sorry for the ignorant question and sorry if geenral thread is not the right place to post it</p>



<a name="164324638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164324638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164324638">(Apr 27 2019 at 08:18)</a>:</h4>
<p><span class="user-mention" data-user-id="128294">@blitzerr</span> I usually run <code>cargo build</code> from a console, but you can set up some asks in VS Code for that. I'm not sure how, though.</p>



<a name="164324681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164324681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164324681">(Apr 27 2019 at 08:18)</a>:</h4>
<p>And there's also an integrated terminal</p>



<a name="164324687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164324687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164324687">(Apr 27 2019 at 08:18)</a>:</h4>
<p>For debugging there was a "native debug" extension IIRC</p>



<a name="164328313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164328313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> L.apz <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164328313">(Apr 27 2019 at 10:09)</a>:</h4>
<p><span class="user-mention" data-user-id="203366">@Jeremy Kolb</span>  It's caused by my local changes. So ill need to look into it</p>



<a name="164331627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/164331627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> blitzerr <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#164331627">(Apr 27 2019 at 11:37)</a>:</h4>
<p>Thanks <span class="user-mention" data-user-id="203546">@Laurențiu Nicola</span></p>



<a name="169523970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169523970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169523970">(Jul 02 2019 at 22:19)</a>:</h4>
<p>Hi all! I'm wondering how coupled the rust-analyzer is to cargo? We're interested in Rust LSP solutions which also work in a Buck-built codebase (as well as Cargo-built). RLS is currently very coupled to Cargo, and its not clear to me how to improve this. <span class="user-mention" data-user-id="153740">@Igor Matuszewski</span> had done some work which allows us to make it work at all, but its still very partial. It looks like rust-analyzer is going in the right direction overall, and so we're thinking of directing all future attention to it.</p>



<a name="169526230"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169526230" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169526230">(Jul 02 2019 at 23:01)</a>:</h4>
<p>Hm, from a quick poke around it looks like the intention is to mediate project interactions via ra_project_model, which already supports Cargo and Json project types. Though it looks like this is a pretty leaky abstraction.</p>



<a name="169542711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169542711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169542711">(Jul 03 2019 at 06:23)</a>:</h4>
<p><span class="user-mention" data-user-id="213049">@Jeremy Fitzhardinge</span> the only thing that really depend on Cargo is <code>cargo check</code> integration. Everything else is completely Cargo-independent in theory, and, in practice, we have that <code>rust-project.json</code> thing</p>



<a name="169542760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169542760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169542760">(Jul 03 2019 at 06:24)</a>:</h4>
<p>The problem with <code>rust-project.json</code> is that I don't know if it is used at all, so it doesn't get as much love as it deserves :-) If you could experiment with it in a real-world use-case, I would be delighted to improve it</p>



<a name="169542997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169542997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169542997">(Jul 03 2019 at 06:30)</a>:</h4>
<p>Yeah, we have some dedicated resources for Rust stuff over the next 6 months, and improving the LSP experience is a big part of that. I'm also interested in the design around directory structure. For example, Cargo's structure means that a directory generally only contains the source for one crate, but that's not necessarily the case with Buck.</p>



<a name="169542998"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169542998" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169542998">(Jul 03 2019 at 06:30)</a>:</h4>
<blockquote>
<p>Though it looks like this is a pretty leaky abstraction.</p>
</blockquote>
<p>Could you elaborate on this a bit more? The intention of <code>rust-project.json</code> is to be more-or less independent from any particular tool, and contain only language-level information. So, it talks about crates in rust-langauge-reference sense, and not about Cargo packages. </p>
<p>The only bit that is specific to rust-analyzer is that <code>roots</code> thing. Unlike compiler, IDE can't just traverse the crate from the root module, it needs to know the directory with sources to be able to watch files and provide features for files not yet included into module hierarchy.</p>



<a name="169543004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169543004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169543004">(Jul 03 2019 at 06:30)</a>:</h4>
<blockquote>
<p>. For example, Cargo's structure means that a directory generally only contains the source for one crate, b</p>
</blockquote>
<p>That's not true: <code>example</code>, <code>tests</code>, and <code>src/bin</code> all contain many crates in one dir</p>



<a name="169543016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169543016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169543016">(Jul 03 2019 at 06:31)</a>:</h4>
<p>Oh, if you are thinking about <code>roots</code> thing, it's totally OK to have many crates share a single root, and it's also ok to share <em>files</em>  between the crates by adding <code>mod foo</code> to two crates.</p>



<a name="169543227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169543227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169543227">(Jul 03 2019 at 06:35)</a>:</h4>
<blockquote>
<p>Could you elaborate on this a bit more?</p>
</blockquote>
<p>Well, that was just an impression from a quick poke around. But if it were a truly hermetic abstraction, I'd expect to only see references to Cargo* in ra_project_model, whereas ra_lsp_server also has cargo_target_spec. But as I say, I haven't really dug into it yet, or thought about how it maps to Buck's model.<br>
We also need to be careful about directory watches. One problem we had with rls was that it traversed the entire directory tree to generate a watch LSP request. This means it ended up traversing many thousands of directories and millions of files, including dirs which contain only build artifacts and caches that it shouldn't be looking at. It would be much more efficient to pass a few <code>**/*.rs</code> style globs.</p>



<a name="169543440"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169543440" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169543440">(Jul 03 2019 at 06:40)</a>:</h4>
<p>Our environment is a large monorepo filled with mostly non-Rust, with some Rust code dotted about in it, not rooted at any particular directory. The most general "project root" would be the top-level dir of the repo, but for that to work the tooling has to avoid anything like explicit directory scans or other operations which are O(repo size). Instead, it needs to look at what files are actually being used, query the buildsystem for dependent crates and their sources, and make efficient use of the editor's dir watching capabilities.</p>



<a name="169543754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169543754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169543754">(Jul 03 2019 at 06:49)</a>:</h4>
<p>Those bits of <code>Cargo</code> elsewhere exist to enhance functionality if Cargo is available. For example, we draw <span aria-label="play" class="emoji emoji-25b6" role="img" title="play">:play:</span> alongside each <code>#[cfg(test)]</code> function, clicking on which launches <code>env RUST_BACKTRACE=short cargo test --nocapture $test_name</code>. For non-cargo based projects, the button is not shown because we wouldn't know what "launching a test" means in buck</p>



<a name="169543916"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169543916" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169543916">(Jul 03 2019 at 06:52)</a>:</h4>
<p>File watching with exclusion is something that is generally supported, though quality of implementation is not ideal yet.</p>



<a name="169543925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169543925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169543925">(Jul 03 2019 at 06:52)</a>:</h4>
<p>Specifically, each <code>SourceRoot</code> comes with a filter that is used by our virtual file system to skip watching something: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/f15f0d1ec006c6c628fb70414d311bd85c2a0469/crates/ra_project_model/src/lib.rs#L61-L77" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/f15f0d1ec006c6c628fb70414d311bd85c2a0469/crates/ra_project_model/src/lib.rs#L61-L77">https://github.com/rust-analyzer/rust-analyzer/blob/f15f0d1ec006c6c628fb70414d311bd85c2a0469/crates/ra_project_model/src/lib.rs#L61-L77</a></p>



<a name="169543970"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169543970" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169543970">(Jul 03 2019 at 06:53)</a>:</h4>
<p>Currently, this is hard-coded to some known offenders like the <code>/target</code> dir, but this totally should be configurable from <code>rust-project.json</code> or <code>.gitingnore</code></p>



<a name="169544126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169544126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169544126">(Jul 03 2019 at 06:56)</a>:</h4>
<p>The bigger problem I envision is that we use the <code>notify</code> crate for file watching, and we historically faced quite a few hard-to-track bugs with it, both because the code on our side is non-trivial, and because something inside <code>notify</code> was wrong. </p>
<p>I <em>think</em> you are already using <code>watchman</code> service though, so I am interested in exploring it as an alternative  solution for file watching. Honestly, I'd just picked watchman for file watching, but I really really want to avoid non-rust dependencies in the <em>default</em> configuration.</p>



<a name="169544871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169544871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169544871">(Jul 03 2019 at 07:12)</a>:</h4>
<p>Yeah, we use watchman extensively. Part of reason for our constraints is that we use a virtual filesystem which manifests things on demand, so any kind of scanning/walking operation is super-expensive because it forces the filesystem to manifest everything. But watchman interfaces with it directly so it gets a live feed of changes as they happen very cheaply.<br>
But my understanding was that file watching was via LSP and mediated by the editor. Am I mistaken?</p>



<a name="169544884"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169544884" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169544884">(Jul 03 2019 at 07:13)</a>:</h4>
<p>As far as things like tests go, we can query for them with buck query, and run them with buck test. So that seems like something that could be abstracted over.</p>



<a name="169545015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169545015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169545015">(Jul 03 2019 at 07:16)</a>:</h4>
<blockquote>
<p>But my understanding was that file watching was via LSP and mediated by the editor. Am I mistaken?</p>
</blockquote>
<p>It <em>is</em> possible to use VS Code file watching services, but that's optional. We deliberately don't do this, for two reasons:</p>
<ul>
<li>VS Code can only watch the folders opened in the editors, but we also need to watch <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> libraries and sysroot</li>
<li>It's nice to have built-in watching which works in any context, and not just in VS Code.</li>
</ul>
<p>If you are curious, our impl of VFS/file watching is here: <a href="https://github.com/rust-analyzer/ra_vfs" target="_blank" title="https://github.com/rust-analyzer/ra_vfs">https://github.com/rust-analyzer/ra_vfs</a></p>



<a name="169545630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169545630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169545630">(Jul 03 2019 at 07:30)</a>:</h4>
<p>Another consideration is that we have a split editor model, where the files are on a different machine from where the UI is displayed. But I guess vscode has formalized that model now.<br>
I don't think the JsonProject would work for our use case. I could make it work by populating the json file from buck, but it would be pretty cumbersome and wouldn't update dynamically. I think it would be better to extract the same information from buck incrementally on the fly. That is, doing a single bulk query to get that info would be a O(repo size) operation. But given a foo/bar/lib.rs, I could query buck to get the target name(s) (ie, crate(s)) that own that file, and then get their transitive deps, and so on. That would be incremental with a cost proportional to the number of files open.</p>



<a name="169548675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169548675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169548675">(Jul 03 2019 at 08:25)</a>:</h4>
<blockquote>
<p>and wouldn't update dynamically</p>
</blockquote>
<p>FWIW, we currently don't support dynamic updates of the project structure at all. There's no blockers for this, just some code that needs to be written, especially in the area of virtual file system where, due to root changes, you need to carefully and transactionally move files from one root to another. </p>
<p>The main idea behind <code>rust-project-json</code> (besides the fact that it's the simplest possible thing) is to make sure that the non-cargo build system and rust-analyzer could exist as separate processes.  Queering buck from rust-analyzer is certainly possible, but I'd rather avoid <code>rust-analyzer -&gt; buck</code> dependency edge. Surface layers of rust-analyzer know about Cargo, yes, but that is a compromise due to the fact that Cargo is a de-facto standard. </p>
<p>What would you think about LSP request like <code>setRustProjectModel</code> instead of <code>rust-project.json</code> file?</p>



<a name="169549021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169549021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169549021">(Jul 03 2019 at 08:32)</a>:</h4>
<blockquote>
<p>But given a foo/bar/lib.rs, I could query buck to get the target name(s) (ie, crate(s)) that own that file, and then get their transitive deps, and so on</p>
</blockquote>
<p>Hm, this might be a problem. rust-analyzer is engineered to know the project information from the start. We maintain a consistent snapshot of all rust-files in memory, and use that as a single source of truth. I think that will always be the case for at least "current crate". For dependencies, we could and should, at some point, to switch to analysis of <code>.rlib</code> files (or rust-analyzer analogue) instead of analysis of the source code.</p>
<p>I need to think about this lazy-loading more. Currently I feel like this probably belongs to the editor layer. Like, if the editor notices that the user opens a file which is not a part of the current project-model, it asks buck for deps of this file, and feeds the new project model to rust-analyzer.</p>



<a name="169588004"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169588004" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169588004">(Jul 03 2019 at 17:55)</a>:</h4>
<p>Yeah, from an overall system design point of view, we really want to avoid a "needs to know everything up front" model, mostly to improve startup latency and memory use. I don't have solid thoughts about how to achieve that goal, and offloading some of it to the editor might make sense. Another option is to have some way to serialize all the interesting state so that it can be bulk downloaded - it might not completely match the actual current state, but it should be close enough that making up the delta is pretty quick.</p>



<a name="169592851"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169592851" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169592851">(Jul 03 2019 at 18:53)</a>:</h4>
<p>A good case to think about with regards to "up front" knowledge is "workspace symbol" query: given a fuzzy query like <code>AnHost</code>, the IDE should find a type whose name is something like <code>AnalysisHost</code>. To do so, it should know the set of type that exist in the project, it can't rely only on the files opened in the editor</p>



<a name="169601017"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169601017" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169601017">(Jul 03 2019 at 20:48)</a>:</h4>
<p>Yeah, that's a tricky case. You could say something like "completion only works within the scope of the transitive deps of the current file", but that might miss out on useful cases, esp if you're trying to work out what crate you should be depending on.</p>



<a name="169653774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169653774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169653774">(Jul 04 2019 at 14:46)</a>:</h4>
<blockquote>
<p>Another option is to have some way to serialize all the interesting state so that it can be bulk downloaded - it might not completely match the actual current state, but it should be close enough that making up the delta is pretty quick.</p>
</blockquote>
<p>Would LSIF fit that goal?</p>



<a name="169664542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169664542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169664542">(Jul 04 2019 at 18:21)</a>:</h4>
<p>Good question, I'll need to look into it. The key feature would be that it can contain the state for multiple source control revisions at once, ideally sharing all the state that's common between revisions.</p>



<a name="169664997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169664997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Fitzhardinge <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169664997">(Jul 04 2019 at 18:33)</a>:</h4>
<p>Hm, doesn't look like its rich enough. The goal would be to avoid having to do a local re-index, rather than offline use.</p>



<a name="169669742"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/general/near/169669742" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/general.html#169669742">(Jul 04 2019 at 20:34)</a>:</h4>
<p>LSIF will a wrong solution here, it lacks language semantics. We basically need <code>.rmeta</code> files</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>